#include <stdio.h>
#include <stdbool.h>

void findPrimes(int start, int end, int *count, int primes[]) {
	bool isPrime[end + 1];
	for (int i = 0; i <= end; i++) {
		isPrime[i] = true;
	}
	isPrime[0] = isPrime[1] = false;
	
	for (int i = 2; i * i <= end; i++) {
		if (isPrime[i]) {
			for (int j = i * i; j <= end; j += i) {
				isPrime[j] = false;
			}
		}
	}
	
	*count = 0;
	for (int num = start; num <= end; num++) {
		if (isPrime[num]) {
			primes[*count] = num;
			(*count)++;
		}
	}
}

int main() {
	int count;
	int primes[end - start + 1];
	
	int start = 100;
	int end = 200;
	
	findPrimes(start, end, &count, primes);
	
	printf("%d\n", count);
	for (int i = 0; i < count; i++) {
		printf("%d ", primes[i]);
	}
	printf("\n");
	
	return 0;
}
